//函数作为返回值
function func(operator){
	function sum(a, b){
		return a + b;
	}
	function sub(a, b){
		return a - b;
	}
	if (operator == "+"){
		return sum;
	}
	if (operator == "-"){
		return sub;
	}
}

var f = func("+");
console.log(f);
console.log(f(6,5));